const Koa = require('koa');
const router = require('koa-router')();
const app = new Koa();
app.use(router.routes()).use(router.allowedMethods());
router.get('/',async ctx=>{
    ctx.cookies.set("name","chengchao")
    ctx.body = "hello world"
})
router.get('/detail',async ctx=>{
    console.log(ctx.cookies.get("name"))
    ctx.body = "detail"
})
router.get('/delete',async ctx=>{
    ctx.cookies.set("name","")
    ctx.body="删除cookie"
})
app.listen(8080)